package com.longdaji.decoration.ui.activitiesOfMine.housemaster;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.longdaji.decoration.R;
import com.longdaji.decoration.base.BaseActivity;
import com.longdaji.decoration.ui.activitiesOfMine.housemaster.dataManagement.DataManagementActivity;
import com.longdaji.decoration.ui.activitiesOfMine.housemaster.receiveIntegral.ReceiveIntegralActivity;
import com.longdaji.decoration.ui.activitiesOfMine.housemaster.wallet.WalletActivity;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class HousemasterActivity extends BaseActivity implements HousemasterContract.View {

    @Inject
    HousemasterContract.Presenter mPresenter;
    @BindView(R.id.tv_tool_title)
    TextView tvTitle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_housemaster);
        setUnBinder(ButterKnife.bind(this));
        if (mPresenter != null)
            mPresenter.setView(this);
        tvTitle.setText("楼栋管理");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mPresenter != null)
            mPresenter.detachView();
    }

    @OnClick({R.id.rl_tool_back, R.id.ll_wallet, R.id.ll_data_manage, R.id.ll_receive_integral})
    void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.rl_tool_back:
                finish();
                break;
            case R.id.ll_wallet:
                startActivity(new Intent(this, WalletActivity.class));
                break;
            case R.id.ll_data_manage:
                startActivity(new Intent(this, DataManagementActivity.class));
                break;
            case R.id.ll_receive_integral:
                startActivity(new Intent(this, ReceiveIntegralActivity.class));
                break;
            default:
                break;
        }
    }
}
